Subject: Re: SASC 6.1 Wrong Protos
From: [email-masked] (Peter Cherna)
Date: 4 Jan 93 20:30:06 GMT
Newsgroups: comp.sys.amiga.programmer

In article <[email-masked]> [email-masked] writes:
>Hullo,
>
>Has anyone noticed that the protos for the BOOPSI method functions
>distributed with SASC (as of patch 6.1) are wrong?
>
>The Msg argument is referred to as Msg *msg, which is incorrect,
>since Msg is already typedef'ed as a pointer. The most recent
>AutoDocs from CBM I have show  this clearly.

That was my typo in the Commodore prototypes (since fixed), which
SAS licenses and supplies.  The autodocs have been right since
they were written.

>And, by the way, either the proto or a pragma file somewhere should
>mention that these functions are __stdargs, or somebody should provide
>a double-standard amiga.lib (like the 6.X standard libraries).

This would be a prototype change.  It couldn't be a pragma, since
these functions are in a linked library, and pragmas bind to
shared-library functions.

>And oh, it seems that the 6.1 Amiga.lib has no HookEntry(), and
>maybe none of the shorthands for BOOPSI methods mentioned in
>AmigaMail and BOOPSI examples that are floating around (DM, DSM).

The original Boopsi examples used functions like DM() and DSM(),
before these functions were added to amiga.lib.  When we added them to
amiga.lib, we opted for the more clear names (eg., DoMethod() and
DoSuperMethod()).  The autodocs for those functions mention the old
names.

HookEntry() is in amiga.lib.  The purpose of HookEntry() is to
convert the hook call (which passes arguments in registers) to a
stack-based call for use with the standard C calling convention of
stack-based arguments.  Hence, HookEntry() is called _HookEntry in
amiga.lib, since a pre-pended underscore signifies a standard
function.  (Note that while HookEntry() actually takes its parameters
in registers, it's never called from C, but is used by stdargs C
programs, so the use of the underscore may be confusing, but it is
necessary).  If you're compiling with registerized arguments, you
don't need a HookEntry() function.  Just have the hook jump directly
to your code, using explicit registers for parameters (__asm and
__register).

If the linker is complaining that it can't find @HookEntry, this
is the problem.  (@ is prepended to regargs functions).

>					Andy

     Peter
--
Peter Cherna, User Interface Development Group, Commodore-Amiga, Inc.
{uunet|rutgers}!cbmvax!peter    [email-masked]
My opinions do not necessarily represent the opinions of my employer.
"Opinions enlarged to show detail"